//
//  Pet.swift
//  PetManager
//
//  Created by 吴翰林 on 2019/11/5.
//  Copyright © 2019 吴翰林. All rights reserved.
//

import UIKit

class Pet: NSObject, NSCoding {
    
    func encode(with aCoder: NSCoder) {
        aCoder.encode(name, forKey: "Name")
        aCoder.encode(iconName, forKey: "IconName")
        aCoder.encode(managerNum, forKey: "ManagerNum")
         aCoder.encode(orderNum,forKey: "OrderNum")
    }
    
    required init?(coder aDecoder: NSCoder) {
        name = aDecoder.decodeObject(forKey: "Name") as! String
        iconName = aDecoder.decodeObject(forKey: "IconName") as! String
        managerNum = aDecoder.decodeObject(forKey: "ManagerNum") as! String
        orderNum = aDecoder.decodeObject(forKey: "OrderNum") as! String
        super.init()
    }
    
    override init() {
        super.init()
    }
    
    init(name: String,managerNum:String,orderNum:String) {
        self.name = name
        self.managerNum = managerNum
        self.orderNum = orderNum
        iconName = "Appointments"
        super.init()
    }
    
    var name = ""
    var iconName = "No Icon"
    var managerNum = ""
    var orderNum = ""
    

}
